package cn.bgs.service.impl;

import cn.bgs.config.DirectConfig;
import cn.bgs.mapper.FeedbackFormMapper;
import cn.bgs.pojo.FeedbackForm;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

/**
 * @program: town-digital
 * @description:
 * @author: Mr.Zhao
 * @create: 2022-08-10 16:20
 */
@Component
public class DircetReciveFeedbackFormService {
    private static final Logger log = LoggerFactory.getLogger(DircetReciveFeedbackFormService.class);

    @Autowired
    private FeedbackFormMapper feedbackFormMapper;

    @RabbitListener(queues = DirectConfig.DIRECT_QUEUE_NAME)
    public void recive(FeedbackForm msg){

        UpdateWrapper<FeedbackForm> updateWrapper = new UpdateWrapper<>();
        updateWrapper.eq("id",msg.getId()).set("offer_state","已结束");
        feedbackFormMapper.update(null, updateWrapper);




    }


}
